home *** CD-ROM | disk | FTP | other *** search
- /*
- File: TranslationComponent.h
-
- Contains: Header file for a translation extension component
-
- Copyright: © 1998 by Apple Computer, Inc., all rights reserved.
- */
-
- #ifndef __TRANSLATIONCOMPONENT__
- #define __TRANSLATIONCOMPONENT__
-
- #ifndef __TRANSLATIONEXTENSIONS__
- #include <TranslationExtensions.h>
- #endif
-
- // Function prototypes
-
- pascal ComponentResult DoGetFileTranslationList(
- ComponentInstance self,
- FileTranslationListHandle translationList);
-
- pascal ComponentResult DoIdentifyFile( ComponentInstance self,
- const FSSpec* theDoc,
- FileType* docKind );
-
- pascal ComponentResult DoTranslateFile( ComponentInstance self,
- TranslationRefNum progressRefNum,
- const FSSpec* srcDoc,
- FileType srcType,
- long srcTypeHint,
- const FSSpec* dstDoc,
- FileType dstType,
- long dstTypeHint );
-
- pascal ComponentResult DoGetScrapTranslationList(
- ComponentInstance self,
- ScrapTranslationListHandle list );
-
- pascal ComponentResult DoIdentifyScrap( ComponentInstance self,
- const void* dataPtr,
- Size dataLength,
- ScrapType* dataFormat );
-
- pascal ComponentResult DoTranslateScrap(ComponentInstance self,
- TranslationRefNum progressRefNum,
- const void* srcDataPtr,
- Size srcDataLength,
- ScrapType srcType,
- long srcTypeHint,
- Handle dstData,
- ScrapType dstType,
- long dstTypeHint );
-
- pascal ComponentResult DoGetTranslatedFilename(
- ComponentInstance self,
- FileType dstType,
- long dstTypeHint,
- FSSpec* theDocument );
-
- #ifdef powerc
-
- // Universal ProcPtr info
-
- enum {
- uppDoGetFileTranslationListProcInfo = kPascalStackBased
- | RESULT_SIZE(SIZE_CODE(sizeof(ComponentResult)))
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(ComponentInstance)))
- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(FileTranslationListHandle))),
-
- uppDoIdentifyFileProcInfo = kPascalStackBased
- | RESULT_SIZE(SIZE_CODE(sizeof(ComponentResult)))
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(ComponentInstance)))
- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(FSSpec*)))
- | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(FileType*))),
-
- uppDoTranslateFileProcInfo = kPascalStackBased
- | RESULT_SIZE(SIZE_CODE(sizeof(ComponentResult)))
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(ComponentInstance)))
- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(TranslationRefNum)))
- | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(FSSpec*)))
- | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(FileType)))
- | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(long)))
- | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(FSSpec*)))
- | STACK_ROUTINE_PARAMETER(7, SIZE_CODE(sizeof(FileType)))
- | STACK_ROUTINE_PARAMETER(8, SIZE_CODE(sizeof(long))),
-
- uppDoGetScrapTranslationListProcInfo = kPascalStackBased
- | RESULT_SIZE(SIZE_CODE(sizeof(ComponentResult)))
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(ComponentInstance)))
- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(ScrapTranslationListHandle))),
-
- uppDoIdentifyScrapProcInfo = kPascalStackBased
- | RESULT_SIZE(SIZE_CODE(sizeof(ComponentResult)))
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(ComponentInstance)))
- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(void*)))
- | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(Size)))
- | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(ScrapType*))),
-
- uppDoTranslateScrapProcInfo = kPascalStackBased
- | RESULT_SIZE(SIZE_CODE(sizeof(ComponentResult)))
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(ComponentInstance)))
- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(TranslationRefNum)))
- | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(void*)))
- | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(Size)))
- | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(ScrapType)))
- | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(long)))
- | STACK_ROUTINE_PARAMETER(7, SIZE_CODE(sizeof(Handle)))
- | STACK_ROUTINE_PARAMETER(8, SIZE_CODE(sizeof(ScrapType)))
- | STACK_ROUTINE_PARAMETER(9, SIZE_CODE(sizeof(long))),
-
- uppDoGetTranslatedFilenameProcInfo = kPascalStackBased
- | RESULT_SIZE(SIZE_CODE(sizeof(ComponentResult)))
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(ComponentInstance)))
- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(FileType)))
- | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(long)))
- | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(FSSpec* )))
-
- };
-
- #endif
-
- // CallComponent macros for PowerPC and 68K
-
- #ifdef powerc
-
- #define CallComponentFunctionWithStorageUniv(storage, params, funcName) \
- CallComponentFunctionWithStorage(storage, params, &funcName##RD)
-
- #define CallComponentFunctionUniv(params, funcName) \
- CallComponentFunction(params, &funcName##RD)
-
- #define INSTANTIATE_ROUTINE_DESCRIPTOR(funcName) \
- RoutineDescriptor funcName##RD = BUILD_ROUTINE_DESCRIPTOR (upp##funcName##ProcInfo, funcName)
-
- #else
- #define CallComponentFunctionWithStorageUniv(storage, params, funcName) \
- CallComponentFunctionWithStorage(storage, params, (ComponentFunctionUPP)funcName)
-
- #define CallComponentFunctionUniv(params, funcName) \
- CallComponentFunction(params, (ComponentFunctionUPP)funcName)
- #endif
-
- #endif // __TRANSLATIONCOMPONENT__
-